Skip to content

chore: enable PMD GuardLogStatement rule#1284

Draft
joaodinissf wants to merge 5 commits intodsldevkit:masterfrom
joaodinissf:chore/pmd-todo-cleanup
Draft

chore: enable PMD GuardLogStatement rule#1284
joaodinissf wants to merge 5 commits intodsldevkit:masterfrom
joaodinissf:chore/pmd-todo-cleanup

Conversation

@joaodinissf
Copy link
Copy Markdown
Collaborator

@joaodinissf joaodinissf commented Mar 7, 2026

Stacked on #1307

Summary

Enable the GuardLogStatement PMD rule for debug/trace levels, and clean up remaining TODO comments in the PMD ruleset.

Test plan

  • mvn compile pmd:pmd pmd:check passes with no violations
  • CI build passes

🤖 Generated with Claude Code

@joaodinissf joaodinissf marked this pull request as draft March 7, 2026 15:16
@joaodinissf joaodinissf force-pushed the chore/pmd-todo-cleanup branch 4 times, most recently from 552a8ad to f9540a3 Compare April 6, 2026 20:24
@joaodinissf joaodinissf changed the title chore: enable PMD GuardLogStatement rule and clean up TODO comments chore: enable PMD GuardLogStatement rule Apr 6, 2026
joaodinissf and others added 5 commits April 6, 2026 22:35
Replace string concatenation, NLS.bind, and MessageFormat.format in
log calls with parameterized {} placeholders. Use Supplier/method-refs
for lazy argument evaluation where appropriate.

Modules: check.core.test, check.runtime.core, check.runtime.ui,
check.ui, checkcfg.core

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace string concatenation with parameterized {} placeholders.
Use Supplier lambdas for lazy argument evaluation. Add NOPMD
suppressions for SLF4J logger calls (SwtBot uses SLF4J, not Log4j).
Add org.apache.logging.log4j.util to OSGi manifests for Supplier.

Modules: test.core, test.ui

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace string concatenation, NLS.bind, and MessageFormat.format in
log calls with parameterized {} placeholders. Use Supplier/method-refs
for lazy argument evaluation. Extract duplicate format strings to
constants. Add org.apache.logging.log4j.util to OSGi manifest.

Modules: xtext, typesystem

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…enerator/UI

Replace string concatenation and NLS.bind in log calls with
parameterized {} placeholders. Use Supplier/method-refs for lazy
argument evaluation. Add NOPMD suppressions for ITraceSet.trace()
and Supplier method-refs not recognized by PMD. Add
org.apache.logging.log4j.util to OSGi manifests.

Modules: xtext.builder, xtext.expression, xtext.generator,
xtext.ui, xtext.test.core

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the GuardLogStatement exclusion and configure the rule for
debug/trace levels. Also replace bare TODO comments on remaining
excluded rules (PreserveStackTrace, UseTryWithResources) with
actionable descriptions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@joaodinissf joaodinissf force-pushed the chore/pmd-todo-cleanup branch from f9540a3 to 8ce505d Compare April 6, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant